﻿using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential)]
public struct Combat
{
    public Character attacker;
    public Life receiver;
    public float damage;
    public static readonly Combat Invalid;
    private static Action<Combat> onAnyCreate;
    [CompilerGenerated]
    private static Action<Combat> <>f__am$cache5;
    static Combat()
    {
        Invalid = new Combat();
        if (<>f__am$cache5 == null)
        {
            <>f__am$cache5 = new Action<Combat>(Combat.<onAnyCreate>m__6E);
        }
        onAnyCreate = <>f__am$cache5;
    }

    public bool isValid
    {
        get
        {
            return (this.receiver != null);
        }
    }
    public static void Create(Character attacker, Life receiver, float damage)
    {
        if (receiver != null)
        {
            Combat combat = new Combat {
                attacker = attacker,
                receiver = receiver,
                damage = damage
            };
            if (receiver != null)
            {
                receiver.TakeCombat(combat);
            }
            onAnyCreate(combat);
        }
    }

    [CompilerGenerated]
    private static void <onAnyCreate>m__6E(Combat combat)
    {
    }

    public static  event Action<Combat> onAnyCreate;
}

